//
//  FastLookViewController.m
//  LOL
//
//  Created by lanou3g on 15/11/19.
//  Copyright © 2015年 syx. All rights reserved.
//

#import "FastLookViewController.h"
#import "NewsViewController.h"

@interface FastLookViewController ()<ViewPagerDelegate,ViewPagerDataSource>

// 存放所有视图控制器数组
@property (nonatomic,strong) NSArray * viewControllArr;
// 存放视图控制器所有标题数组
@property (nonatomic,strong) NSArray * titleArr;

@end


@implementation FastLookViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.viewControllArr = [NSArray new];
    self.titleArr = [NSArray new];
    
    self.viewControllArr = @[@"c12",@"c73",@"c3",@"c18",@"c10",@"c23"];
    self.titleArr = @[@"最新",@"赛事",@"官方",@"娱乐",@"攻略",@"活动"];
    
    self.delegate = self;
    self.dataSource = self;
    
}

//标题
- (UIView *)viewPager:(ViewPagerController *)viewPager viewForTabAtIndex:(NSUInteger)index{
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(index*80, 0, 80, 20)];
    label.font = [UIFont systemFontOfSize:14];
    label.textAlignment = NSTextAlignmentCenter;
    label.text = [NSString stringWithFormat:@"%@",self.titleArr[index]];
    label.layer.cornerRadius = 10;
    return label;
}

//当前的viewController
- (UIViewController *)viewPager:(ViewPagerController *)viewPager contentViewControllerForTabAtIndex:(NSUInteger)index{
    
    NewsViewController * newsVC = [NewsViewController new];
    newsVC.urlStr = self.viewControllArr[index];
    return newsVC;
    
}

//界面的个数
- (NSUInteger)numberOfTabsForViewPager:(ViewPagerController *)viewPager{
    return self.titleArr.count;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
